import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import ElementUI from "element-ui";
import vueAxios from "vue-axios";
import axios from "axios";
import VueCookies from "vue-cookies";
import "element-ui/lib/theme-chalk/index.css";
import myrequire from "@/assets/js/require";

import { selectDictLabel } from "../src/assets/js/utlis";
import md5 from "js-md5";
import { message } from "./assets/js/resetMessage";
import $ from "jquery";
import "../src/assets/js/lastTime";
import "../src/assets/js/validation";




//图片查看器!
import duoImageViewer from "duo-image-viewer"; // 引入组件
import VueAMap from "vue-amap";

VueAMap.initAMapApiLoader({
  key: "2fe2d67ae68d0dbc9c5487822117c617",
  plugin: [
    "AMap.Autocomplete",
    "AMap.PlaceSearch",
    "AMap.Scale",
    "AMap.OverView",
    "AMap.ToolBar",
    "AMap.MapType",
    "AMap.Geolocation",
    "AMap.Geocoder",
    "AMap.AMapManager",
    "AMap.Marker"
  ],
  v: '2.0'
});

Vue.use(VueAMap);
Vue.use(duoImageViewer) // 注册组件


// import Viewer from "v-viewer";
// import "viewerjs/dist/viewer.css";
// import "../src/assets/js/aliyun-webrtc-sdk-1.14.2"

//导入reset css样式
import "../src/assets/style/reset.css";
import "../src/assets/style/result.css";
// import "../src/assets/style/media.css";

Vue.config.productionTip = false;
Vue.use(ElementUI);
Vue.use(vueAxios, axios);
Vue.use(VueCookies);
Vue.use(myrequire);
// Vue.use(Viewer, {
//   defaultOptions: {
//     zIndex: 9999
//   }
// });
// Viewer.setDefaults({
//   // 工具栏按钮的控制
//   toolbar: {
//     zoomIn: 1, // 放大
//     zoomOut: 1, // 缩小
//     // oneToOne: 1, // 100%大小
//     // reset: 1, // 还原
//     prev: 1, // 上一张
//     play: 1, // 全屏显示
//     next: 1, // 下一张
//     rotateLeft: 1, // 逆时针旋转
//     rotateRight: 1 // 顺时针旋转
//     // flipHorizontal: 1, // 水平翻转
//     // flipVertical: 1 // 垂直翻转
//   }
// });

Vue.prototype.$md5 = md5;
Vue.prototype.selectDictLabel = selectDictLabel;

Vue.prototype.$message = message; //重写message提示框  一定要放在Vue.use(ElementUI)之后
Vue.prototype.$ = $;

//全局防抖
Vue.directive("noMoreClick", {
  inserted(el) {
    el.addEventListener("click", () => {
      el.classList.add("is-disabled");
      el.disabled = true;
      setTimeout(() => {
        el.disabled = false;
        el.classList.remove("is-disabled");
      }, 3000);
    });
  }
});

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
